package org.example.entity;

import java.sql.Timestamp;

public class Favorite {
    private int id;
    private int userId;
    private int contentId;
    private String contentType;
    private Timestamp createdAt;

    // 用于显示的内容信息
    private String title;
    private String imageUrl;

    // 构造方法
    public Favorite() {}

    public Favorite(int userId, int contentId, String contentType) {
        this.userId = userId;
        this.contentId = contentId;
        this.contentType = contentType;
    }

    // Getter 和 Setter 方法
    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public int getUserId() {
        return userId;
    }

    public void setUserId(int userId) {
        this.userId = userId;
    }

    public int getContentId() {
        return contentId;
    }

    public void setContentId(int contentId) {
        this.contentId = contentId;
    }

    public String getContentType() {
        return contentType;
    }

    public void setContentType(String contentType) {
        this.contentType = contentType;
    }

    public Timestamp getCreatedAt() {
        return createdAt;
    }

    public void setCreatedAt(Timestamp createdAt) {
        this.createdAt = createdAt;
    }

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public String getImageUrl() {
        return imageUrl;
    }

    public void setImageUrl(String imageUrl) {
        this.imageUrl = imageUrl;
    }

    @Override
    public String toString() {
        return "Favorite{" +
                "id=" + id +
                ", userId=" + userId +
                ", contentId=" + contentId +
                ", contentType='" + contentType + '\'' +
                ", createdAt=" + createdAt +
                ", title='" + title + '\'' +
                ", imageUrl='" + imageUrl + '\'' +
                '}';
    }
}